using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
namespace Microsoft.Phone.Controls
{
	public static class CultureInfoExtensions
	{
		private static string[] CulturesWithTFWeekends = new string[]
		{
			"ar-SA"
		};
		private static string[] CulturesWithFSWeekends = new string[]
		{
			"he-IL",
			"ar-EG"
		};
		public static ReadOnlyCollection<string> Weekdays(this CultureInfo culture)
		{
			DayOfWeek[] array2;
			if (Enumerable.Contains<string>(CultureInfoExtensions.CulturesWithTFWeekends, culture.get_Name()))
			{
				DayOfWeek[] array = new DayOfWeek[5];
				array[0] = 1;
				array[1] = 2;
				array[2] = 3;
				array[3] = 6;
				array2 = array;
			}
			else
			{
				if (Enumerable.Contains<string>(CultureInfoExtensions.CulturesWithFSWeekends, culture.get_Name()))
				{
					DayOfWeek[] array3 = new DayOfWeek[5];
					array3[0] = 1;
					array3[1] = 2;
					array3[2] = 3;
					array3[3] = 4;
					array2 = array3;
				}
				else
				{
					array2 = new DayOfWeek[]
					{
						1,
						2,
						3,
						4,
						5
					};
				}
			}
			List<string> list = new List<string>();
			DayOfWeek[] array4 = array2;
			for (int i = 0; i < array4.Length; i++)
			{
				DayOfWeek dayOfWeek = array4[i];
				list.Add(culture.get_DateTimeFormat().GetDayName(dayOfWeek));
			}
			return new ReadOnlyCollection<string>(list);
		}
		public static ReadOnlyCollection<string> Weekends(this CultureInfo culture)
		{
			DayOfWeek[] array2;
			if (Enumerable.Contains<string>(CultureInfoExtensions.CulturesWithTFWeekends, culture.get_Name()))
			{
				DayOfWeek[] array = new DayOfWeek[]
				{
					4,
					5
				};
				array2 = array;
			}
			else
			{
				if (Enumerable.Contains<string>(CultureInfoExtensions.CulturesWithFSWeekends, culture.get_Name()))
				{
					DayOfWeek[] array3 = new DayOfWeek[]
					{
						5,
						6
					};
					array2 = array3;
				}
				else
				{
					DayOfWeek[] array4 = new DayOfWeek[2];
					array4[0] = 6;
					DayOfWeek[] array5 = array4;
					array2 = array5;
				}
			}
			List<string> list = new List<string>();
			DayOfWeek[] array6 = array2;
			for (int i = 0; i < array6.Length; i++)
			{
				DayOfWeek dayOfWeek = array6[i];
				list.Add(culture.get_DateTimeFormat().GetDayName(dayOfWeek));
			}
			return new ReadOnlyCollection<string>(list);
		}
	}
}
